Redux, useSelector, useDispatch


用 hooks 取代 connect

connect => hooks
取資料: mapStateToProps => useSelector
更新資料: mapDispatchToProps => useDispatch

import { Provider, useSelector, useDispatch } from 'react-redux';
import { addTodo } from './action/todolist';







你可能感興趣的文章

AI輔導室|製作繩結效果

AI輔導室|製作繩結效果

[Release Notes] 20201122_v1 - Support Google Oauths Login/Signup

[Release Notes] 20201122_v1 - Support Google Oauths Login/Signup

透過瀏覽器傳送資料的方式與限制

透過瀏覽器傳送資料的方式與限制






留言討論